/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.loli.hernandez.modelo.beans;

/**
 *
 * @author nestor
 */
public class TableColumn {
   
    private String field, type,  defaultValue, extra;
    private boolean nullAllowed;
    private boolean primaryKey;
    
    //Esta variable almacena si es o no la columna 
    //seleccionada para que se genere código
    private boolean allowedForCodeGeneration;
    
    
    
    /**
     * @return the field
     */
    public String getField() {
        return field;
    }

    /**
     * @param field the field to set
     */
    public void setField(String field) {
        this.field = field;
    }

    /**
     * @return the type
     */
    public String getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(String type) {
        this.type = type;
    }


    /**
     * @return the defaultValue
     */
    public String getDefaultValue() {
        return defaultValue;
    }

    /**
     * @param defaultValue the defaultValue to set
     */
    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    /**
     * @return the extra
     */
    public String getExtra() {
        return extra;
    }

    /**
     * @param extra the extra to set
     */
    public void setExtra(String extra) {
        this.extra = extra;
    }

    /**
     * @return the nullAllowed
     */
    public boolean isNullAllowed() {
        return nullAllowed;
    }

    /**
     * @param nullAllowed the nullAllowed to set
     */
    public void setNullAllowed(String value) {
        this.nullAllowed = (value.equals("NO") ? false : true);
    }

    /**
     * @return the primaryKey
     */
    public boolean isPrimaryKey() {
        return primaryKey;
    }

    /**
     * @param primaryKey the primaryKey to set
     */
    public void setPrimaryKey(String value) {
        this.primaryKey = (value.equals("PRI") ? true : false);
    }

    /**
     * @return the allowedForCodeGeneration
     */
    public boolean isAllowedForCodeGeneration() {
        return allowedForCodeGeneration;
    }

    /**
     * @param allowedForCodeGeneration the allowedForCodeGeneration to set
     */
    public void setAllowedForCodeGeneration(boolean allowedForCodeGeneration) {
        this.allowedForCodeGeneration = allowedForCodeGeneration;
    }
}
